package com.dfbz.demo07_反射与泛型;

import org.junit.Test;

import java.lang.reflect.Method;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo03_桥接方法 {

    @Test
    public void test1() throws Exception {

        Class<IExample> exampleClass = IExample.class;
        Method[] methods = exampleClass.getDeclaredMethods();
        for (Method method : methods) {
            System.out.println(method);
        }
    }


    @Test
    public void test2() throws Exception {

        Class<ExampleImpl> exampleClass = ExampleImpl.class;
        Method[] methods = exampleClass.getDeclaredMethods();
        for (Method method : methods) {
            System.out.println(method);
        }

    }
}


interface IExample<T> {
    T method(T t);
}

class ExampleImpl implements IExample<Number> {

    @Override
    public Number method(Number number) {
        return number;
    }
}